<?php
namespace app\model;

use Lcobucci\JWT\Parser;
use Lcobucci\JWT\ValidationData;
use think\Model;
use Lcobucci\JWT\Builder;
use Lcobucci\JWT\Signer\Hmac\Sha256;
use Lcobucci\JWT\Signer\Key;

class User extends Model
{
    protected $name = 'user';
    /**
     * 获取用户列表
     */
    public function  userList($param=[]){
        $isLogin = isAdminLogin($param['admin_id']);
        if ($isLogin){
            return $isLogin;
        }
        $pageSize = $param['page_size'] ?? 15 ;
        $page = $param['page'] ?? 1;
        $total = self::count();
        $list = self::page($page,$pageSize)->order('id','desc')->select();
        $result = [
            'total'=>$total,
            'list'=>$list,
        ];
        return getSuccessResponse('查询成功',$result);
    }
}